During endoscopic procedure using a flexible endoscope, the shape of the endoscope is typically deformed due to constraints of the body passages through which the endoscope must pass, as well as to steering of the endoscope by the operator. As a result, the operator may have difficulty in determining the actual orientation of the distal end of the endoscope, and may therefore be unable to correctly associate the positions of objects seen in endoscopic images with the actual locations of the objects in the patient's body.
In response to these problems, methods have been proposed for measuring the orientation of the endoscope, and then rotating the endoscopic image optically, mechanically or electronically to compensate for the orientation. Exemplary methods for such purposes are described in U.S. Pat. Nos. 6,478,743, 5,545,120, 6,471,637, 6,097,423, U.S. Patent Application Publication 2002/0161280, and U.S. Pat. No. 6,663,559, whose disclosures are incorporated herein by reference. Measurements of the orientation of an invasive probe, such as an endoscope or catheter, may also be used in controlling other types of procedures carried out inside the body using the probe.